﻿Imports Alquilaqi

Public Class Autentica

    ' TODO: Insert code to perform custom authentication using the provided username and password 
    ' (See http://go.microsoft.com/fwlink/?LinkId=35339).  
    ' The custom principal can then be attached to the current thread's principal as follows: 
    '     My.User.CurrentPrincipal = CustomPrincipal
    ' where CustomPrincipal is the IPrincipal implementation used to perform authentication. 
    ' Subsequently, My.User will return identity information encapsulated in the CustomPrincipal object
    ' such as the username, display name, etc.

    Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click

        Dim negocio As New AdministradorNegocio
        Try
            Dim modelo = negocio.validar(Me.UsernameTextBox.Text, Me.PasswordTextBox.Text)
            Dim mdi As PrincipalMDI = New PrincipalMDI

            'SE DESHABILITA TODOS LOS FORMULARIOS
            mdi.CentroDeEstudiosToolStripMenuItem.Visible = True
            mdi.InmuebleToolStripMenuItem.Visible = True
            mdi.VerToolStripMenuItem.Visible = True

            'despues de loguearse se oculta ese formulario :Me.Visible = False
            mdi.Show()
            Me.Visible = False

        Catch ex As Exception
            MsgBox("intente otra vez por favor", vbExclamation, "error")
            'Me.lblError.Te "Usuario y/o Clave incorrectos" + ex.ToString
        End Try
    End Sub

    Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
        Me.Close()
    End Sub

    'Private Sub Autentica_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    'End Sub

    Private Sub Autentica_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class
